【工具使用】Slither:Solidity静态分析框架 您所在的位置:网站首页 eth 合约 开发工具 【工具使用】Slither:Solidity静态分析框架

【工具使用】Slither:Solidity静态分析框架

#【工具使用】Slither:Solidity静态分析框架| 来源: 网络整理| 查看: 265

工具简介

Slither 是一个 python3 开发,用于检测智能合约(solidity)漏洞的静态分析框架。 Slither 的 Github 地址:https://github.com/crytic/slither

工具安装

它有三种安装方式(pip, git, docker),我们为了方便,采用docker进行安装。因为工具包 Ethereum Security Toolbox 中包括了 Slither 工具,所以我们直接通过安装工具包 Ethereum Security Toolbox 的 docker 来获取 Slither。

智能合约工具箱docker安装:https://github.com/crytic/eth-security-toolbox

安装指令 docker pull trailofbits/eth-security-toolbox 构建docker docker run -it -v : trailofbits/eth-security-toolbox // example docker run -it -v F:\contracts:/contracts trailofbits/eth-security-toolbox

这行指令的作用是启动docker,其中 -v是指将本地的磁盘目录映射到docker中。

local path:本地磁盘目录 docker path:映射到docker中的目录 trailofbits/eth-security-toolbox:docker名称 查看映射目录 ethsec@560c87507f28:~$ cd / ethsec@560c87507f28:/$ ls contracts bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var ethsec@560c87507f28:/$ cd contracts/ ethsec@560c87507f28:/contracts$ ls constant contracts decode migrations package.json readme.md scripts test truffle-config.js 使用

在 Truffle/Embark/Dapp/Etherlime/Hardhat 项目上使用 Slither

slither .

在单个文件上上使用 Slither

slither tests/uninitialized.sol

可配合solc-select进行solc版本的选择。

后记

截至 21.6.3 为止,Slither支持的solc最高版本是0.7.4,很不幸我想分析的合约是0.8.x的。也尝试了一下自己在docker里面更新solc,但提示权限不足失败告终。无能狂怒只能提个issue祈祷一下开发者尽快更新0.8.x版本吧。然后,也看了其他的几个漏扫,但是好像都不支持0.8.x版本的合约,迷茫的阿菜该何去何从。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有